#include <iostream>
using namespace std;

class Member {
public:
	Member (void):m_i(0) {
		cout << "Member::Member(void)" << endl;
	}
	Member (int i):m_i(i) {
		cout << "Member::Member(int)" << endl;
	}
	int m_i;
};

class Base {
public:
	Base (void):m_i (0) {
		cout << "Base::Base(void)" << endl;
	}
	Base (int i):m_i (i) {
		cout << "Base::Base(int)" << endl;
	}
	int m_i;
};

class Derived:public Base {
public:
	Derived (void) {
		cout << "Derived::Derived(void)" << endl;
	}
	Derived (int i):Base(i), m_member(i) {
		//Base(i),指明基类子对象的初始化方式
		//m_member(i), 指明成员子对象的初始化方式
		cout << "Derived::Derived(int)" << endl;
	}
	Member m_member;
};

int main (void)
{
	Derived d;
	cout << d.m_i << ',' <<  d.m_member.m_i <<endl;
	Derived d2(1234);
	cout << d2.m_i << ',' <<  d2.m_member.m_i <<endl;
	return 0;
}
